/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package formulagraph;

import formulagraph.lineas.Linea;

/**
 *
 * @author soler4888
 */
public class Segmento {
    private Punto p1;
    private Punto p2;
    private Linea linea;

    public Segmento(Punto p1, Punto p2, Linea linea) {
        this.p1 = p1;
        this.p2 = p2;
        this.linea = linea;
    }

    public Linea getLinea() {
        return linea;
    }
    
    public String dibujar() {
        StringBuilder builder = new StringBuilder();
        
        builder.append("<line ");
        builder.append("x1=\"").append(p1.getX()).append("\" ");
        builder.append("y1=\"").append(p1.getY()).append("\" ");
        builder.append("x2=\"").append(p2.getX()).append("\" ");
        builder.append("y2=\"").append(p2.getY()).append("\" ");
        builder.append(linea.dibujar());
        builder.append(" />");
        
        return builder.toString();
    }
    
}
